In a computer system, a counter holds data and can increment and provide the value of the data upon request. For example, a counter may be implemented in a register which holds numbers from zero to 255. Upon request, the counter increments the number by 1, mod 255. Upon request, the counter reports the value of the number in the register. Depending on the use of the counter, different increments may be preferable. “Increments” may be mathematical operations other than addition; for example, a multiplication may be performed. Generally, a counter reports on counter data and allows the modification of the counter data in a predetermined way.
It may be desirable in some contexts to implement a counter in hardware in a computer system in order to present barriers to adversaries attempting to modify the counter. Counters have been implemented in flash memory. However a limitation of flash memory is that when data in flash memory is changed, any bit transitions from 1 to 0 will cause flash memory to need to be erased and rewritten. If all bits remain the same or transition from 0 to 1, then no erasure is required for the change. Conventionally, flash memory has a limited lifespan of 10,000 to 1,000,000 erasures.
Users prefer computer system components to have a long life. Additionally, while some portions of a computer system may be replaceable, for security reasons, a flash counter may be made more difficult or impossible to exchange, in order to combat improper use by an adversary. Thus, the life of a counter is even more important. There is a need for a flash memory counter with an improved lifespan.
Thus, there is a need for a counter implementation that properly addresses and satisfies heretofore unfilled needs in the art.